import package.SearchPassWord as fpw
import package.Md5 as md5


def password():
    print("Enter User：", end="")
    User = str(input())

    print("Enter password：", end="")
    password = str(input())

    result = fpw.search(User, md5.encrypt_password(password))
    if result == 1:
        return True
    else:
        return False


flag = False


def main():
    print("Weclcome to MySimpleDB!")

    while password() == False:
        print("Wrong PassWord!")

    while True:
        print("mysql>", end="")
        user_input = ""

        t = input()
        while True:
            user_input += t
            if ';' in t:
                break

            print("    ->",end="")
            t = input()
        print(user_input)


if __name__ == "__main__":
    main()
